package com.vang.chue.capm.entity;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: chuevang
 * Date: 11/9/11
 * Time: 9:30 PM
 * To change this template use File | Settings | File Templates.
 */
public class CollectivePersonPK implements Serializable {
    private long personId;

    public long getPersonId() {
        return personId;
    }

    public void setPersonId(long personId) {
        this.personId = personId;
    }

    private String collectiveId;

    public String getCollectiveId() {
        return collectiveId;
    }

    public void setCollectiveId(String collectiveId) {
        this.collectiveId = collectiveId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CollectivePersonPK that = (CollectivePersonPK) o;

        if (personId != that.personId) return false;
        if (collectiveId != null ? !collectiveId.equals(that.collectiveId) : that.collectiveId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (personId ^ (personId >>> 32));
        result = 31 * result + (collectiveId != null ? collectiveId.hashCode() : 0);
        return result;
    }
}
